package cn.edu.nju.askme.action;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import cn.edu.nju.askme.model.Paper;
import cn.edu.nju.askme.service.IPaperService;

import com.opensymphony.xwork2.ActionSupport;

/**
 * @author ZZ
 * 
 */
@Component
public class PaperListAllAction extends ActionSupport {
	private IPaperService paperService;
	private List<Paper> paperList;

	public IPaperService getPaperService() {
		return paperService;
	}

	@Resource
	public void setPaperService(IPaperService paperService) {
		this.paperService = paperService;
	}

	public List<Paper> getPaperList() {
		return paperList;
	}

	public void setPaperList(List<Paper> paperList) {
		this.paperList = paperList;
	}

	@Override
	public String execute() throws Exception {
		paperList = paperService.checkAll();
		System.out.println(paperList.size());
		return SUCCESS;
	}
}
